package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.FetchOrientation;
import com.yanmaohu.yulia.bean.LocalQualifiedName;
import com.yanmaohu.yulia.bean.TargetSpecificationList;

/**
 * @author Bright Lee
 */
public final class FetchStatement implements SqlDataStatement, Statement {

    private int beginIndex;
    private int endIndex;
    private FetchOrientation fetchOrientation;
    private boolean from;
    private LocalQualifiedName cursorName;
    private TargetSpecificationList fetchTargetList;

    public FetchStatement(int beginIndex,
                          int endIndex,
                          FetchOrientation fetchOrientation,
                          boolean from,
                          LocalQualifiedName cursorName,
                          TargetSpecificationList fetchTargetList) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
        this.fetchOrientation = fetchOrientation;
        this.from = from;
        this.cursorName = cursorName;
        this.fetchTargetList = fetchTargetList;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public FetchOrientation getFetchOrientation() {
        return fetchOrientation;
    }

    public boolean isFrom() {
        return from;
    }

    public LocalQualifiedName getCursorName() {
        return cursorName;
    }

    public TargetSpecificationList getFetchTargetList() {
        return fetchTargetList;
    }

}
